package com.maker.LMMS.hook;

import com.blade.ioc.annotation.Bean;
import com.blade.mvc.RouteContext;
import com.blade.mvc.hook.WebHook;
import com.blade.mvc.http.Request;
import com.maker.LMMS.service.ShowImpl;

/**
 * @author : zimu
 * @Date: 2018/7/31 20:35
 * @description :
 */

@Bean
public class UserHook implements WebHook {
    @Override
    public boolean before(RouteContext signature) {
        System.out.println("test before>>>>>>>");
        Request request = signature.request();
        String uri = request.uri();
        if(uri.indexOf("/backstage")!=0){
            if (request.session().attribute("name")!=null) {
                ShowImpl show = new ShowImpl();
                show.showNews(request);
            }
        }
        return true;
    }
}
